# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-atpublic
pkgver=4.1.0
pkgrel=0
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=atpublic
pkgdesc="@public decorator for Python"
url="https://github.com/aio-libs/aiosmtpd"
arch="noarch"
license="Apache-2.0"
checkdepends="
	py3-pytest-cov
	py3-sybil
"
makedepends="
	py3-setuptools
	py3-hatchling
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/warsaw/public/-/archive/$pkgver/public-$pkgver.tar.gz"
builddir="$srcdir/public-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e6608572a6dfff0b9fa9039c6f7aea4488caabb89a2dcafc19435693b861336cd100da16c8f4bde0b8b454eea0354f0baedf3bf1ccdc8536b1dc11129e972f22  py3-atpublic-4.1.0.tar.gz
"
